<html>
<head><meta charset="utf-8"><title>find references  on `fn` · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/find.20references.20.20on.20.60fn.60.html">find references  on `fn`</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="201063621"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/find%20references%20%20on%20%60fn%60/near/201063621" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Brennan Vincent <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/find.20references.20.20on.20.60fn.60.html#201063621">(Jun 16 2020 at 19:36)</a>:</h4>
<p>how hard would it be to make it so finding references on the <code>fn</code> keyword (as opposed to the name of the function) would find references to the function being defined?</p>



<a name="201074961"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/find%20references%20%20on%20%60fn%60/near/201074961" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/find.20references.20.20on.20.60fn.60.html#201074961">(Jun 16 2020 at 21:13)</a>:</h4>
<p>Should be pretty trivial, but I wonder why this is desirable? Navigations<br>
such as goto definition or document symbols put caret on function<br>
identifier anyway, having the cursor on fn seems pretty rare?</p>



<a name="201488679"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/find%20references%20%20on%20%60fn%60/near/201488679" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Brennan Vincent <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/find.20references.20.20on.20.60fn.60.html#201488679">(Jun 20 2020 at 17:47)</a>:</h4>
<p>R-A isn't the only way to navigate; sometimes I also use search :). This happens to me when searching my editor for <code>fn foo</code>. In vim/spacemacs and similar, this will cause the cursor to be on the <code>fn</code> token.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>